package Strategy.Demo;

import Strategy.Demo.Ducks.LvTouDuck;
import Strategy.Demo.Ducks.SuLiaoDuck;
import Strategy.Demo.Interfaces.Duck;

/**
 * 策略模式——定义算法族，分别封装起来，让他们相互之间可以替换，此模式让算法的变化独立于使用算法的客户
 * @Author: pengzx
 * @Description:
 * @Date: 11:02 2017/9/5
 * @Modified by: 1.0
 */
public class Demo {
    public static void main(String[] args){
        Duck duck = new LvTouDuck();
        duck.display();
        duck.performDuack();
        duck.performFly();
        System.out.println("------------------------------------");
        Duck duck2 = new SuLiaoDuck();
        duck2.display();
        duck2.performDuack();
        duck2.performFly();
    }
}
